package com.hison.service;

import com.hison.domian.dto.AddArticleDto;
import com.hison.domian.dto.ArticleDto;
import com.hison.domian.entity.Article;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hison.domian.vo.ArticleByIdVo;
import com.hison.domian.vo.PageVo;
import com.hison.util.ResponseResult;

/**
* @author hison
* @description 针对表【sg_article(文章表)】的数据库操作Service
* @createDate 2024-01-12 11:06:08
*/
public interface ArticleService extends IService<Article> {

    /**
     * 查询热门文章
     * @return {@link ResponseResult}
     */
    ResponseResult hotArticleList();

    /**
     * 分页查询文章
     * @return {@link ResponseResult}
     */
    ResponseResult articleList(Integer pageNum, Integer  pageSize, Long categoryId);

    /**
     * 根据id获取文章详情接口
     * @param id
     * @return {@link ResponseResult}
     */
    ResponseResult getAticleDetail(Long id);

    ResponseResult updateViewCount(Long id);

    //新增博客文章
    ResponseResult add(AddArticleDto article);

    PageVo selectArticlePage(Article article, Integer pageNum, Integer pageSize);

    //修改文章-①根据文章id查询对应的文章
    ArticleByIdVo getInfo(Long id);

    //修改文章-②然后才是修改文章
    void edit(ArticleDto article);

    ResponseResult deleteByID(Long id);
}
